/*
package com.wz.mapper;

import com.wz.pojo.Department;
import com.wz.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Repository
public class UserInfoDao {
    private static Map<Integer,UserInfo> UserInfoDaoMap =null;
    //员工所属部门
    @Autowired
    private DepartmentDao departmentDao;
    static {
        UserInfoDaoMap=new HashMap<Integer,UserInfo>();
        UserInfoDaoMap.put(1001,new UserInfo(1001,"张碎","936566415@QQ.COM",1,new Date(),new Department(101,"教学部")));
        UserInfoDaoMap.put(1002,new UserInfo(1002,"林心","912313442@QQ.COM",0,new Date(),new Department(102,"市场部")));
        UserInfoDaoMap.put(1003,new UserInfo(1003,"何苗","123124421@QQ.COM",0,new Date(),new Department(103,"教研部")));
        UserInfoDaoMap.put(1004,new UserInfo(1004,"何绍","412234434@QQ.COM",1,new Date(),new Department(104,"运营部")));
        UserInfoDaoMap.put(1005,new UserInfo(1005,"南都","131234635@QQ.COM",0,new Date(),new Department(105,"行政部")));
    }
    //主键自增
    private  static Integer intId=1006;

    //增加员工
    public void  insert(UserInfo userInfo){
        if(userInfo.getUserID()==null){
            userInfo.setUserID(intId++);
        }
        userInfo.setDepartment(departmentDao.getDepartmentById(userInfo.getDepartment().getId()));
        UserInfoDaoMap.put(userInfo.getUserID(),userInfo);
    }

    //查询全部员工信息
    public Collection<UserInfo> getAll(){
        return UserInfoDaoMap.values();
    }

    //通过id查询员工
    public UserInfo getUserById(Integer id){
        return  UserInfoDaoMap.get(id);
    }

    //删除员工根据id
    public  void delete(Integer id){
        UserInfoDaoMap.remove(id);
    }

}
*/
